package com.qf.fmall2203.index.controller;

import com.qf.fmall2203.index.entity.IndexImg;
import com.qf.fmall2203.index.service.IIndexImgService;
import com.qf.fmall2203.index.service.impl.IndexImgServiceImpl;
import com.qf.fmall2203.user.service.impl.UsersServiceImpl;
import com.qf.fmall2203.vo.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 轮播图  前端控制器
 * </p>
 *
 * @author ljc
 * @since 2023-02-13
 */
@RestController
@RequestMapping("/index")
@CrossOrigin
public class IndexImgController {

    @Autowired
    IIndexImgService indexImgService;

    @GetMapping("/indeximg")
    public ResultVo indexing(){

        ResultVo resultVo =  indexImgService.getIndex();

        return resultVo;
    }

    @GetMapping("/category-list")
    public ResultVo  categoryList(){

        ResultVo vo = indexImgService.getCategoryList();

        return vo;
    }
    @GetMapping("/list-recommends")
    public ResultVo listRecommends(){

        ResultVo vo = indexImgService.getListR();

        return vo;
    }

    @GetMapping("/category-recommends")
    public ResultVo categoryRecommends(){

       ResultVo vo =  indexImgService.getCategoryRecommends();
        return vo;

    }

}
